<% resources.each do |resource| %>
  <%= render :partial => 'entities/entity', :locals => { :entity => resource, :prefix_id=> prefix_id } %>
<% end %>


<script>
  <%if request.xhr?%>
  	pageless_state.home.url = "/home?tab=home&ids_to_avoid=<%=ids_to_avoid.join(',')%>";
    force_update_pageless("home", <%=resources.num_pages%>, <%=resources.current_page%>);
  <%else%>
    document.addEventListener("DOMContentLoaded", function(){  
      pageless_state.home.url = "/home?tab=home&ids_to_avoid=<%=ids_to_avoid.join(',')%>";
      force_update_pageless("home", <%=resources.num_pages%>, <%=resources.current_page%>);
    });
  <%end%>
	
</script>